#include<bits/stdc++.h>
using namespace std;
int n,a[200100],f,v[200100];
int main()
{
//	freopen("fruit.in","r",stdin);
//	freopen("fruit.out","w",stdout);
	cin>>n;
	for(int i=1;i<=n;i++)
		cin>>a[i];
	while(1)
	{
		f=0;
		for(int i=1;i<=n;i++)
		{
			if(a[i]!=a[i-1])
			{
				f++;
				cout<<i<<" ";
				v[i]=-1;
			}
		}
		cout<<endl;
		
		for(int i=1;i<=n;i++)
		{
			if(v[i]==-1)
				a[i]=-1;	
		}
		
		if(f==0)
			break;
			
		for(int i=1;i<=n;i++)
		{
			if(a[i]==-1)
			{
				for(int j=i+1;j<=n;j++)
				{
					if(a[j]!=-1)
					{
						a[i]=a[j];
						a[j]=-1;
						break;
					}
				}
			}
		}
		memset(v,0,sizeof(v));
	}
	return 0;
}
